import React, { Component } from 'react'
export default function AsyncComponent(improtComponent) {
    class App extends Component {
        constructor(props) {
            super(props)
            this.state = {
                component: null
            }
        }
        async componentDidMount() {
            const { default: component } = await improtComponent()
            this.setState({
                component: component
            })
        }
        render() {
            const A = this.state.component
            return A ? <A /> : null
        }
    }
    return App
}